package com.workerhelping.elasticsearchEntity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Document(indexName = "income",type = "income")
public class ESIncomeVO implements Serializable {
    @Id
    private Integer id;
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Field(type = FieldType.Date,pattern = "yyyy-MM-dd")
    private Date incomeDate;
    @Field(type = FieldType.Keyword)
    private String year;
    @Field(type = FieldType.Text)
    private String source;
    @Field(type = FieldType.Double)
    private Double money;
    @Field(type = FieldType.Keyword)
    private String category;
}
